﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataObject.DataAccess;
using DataObject.Database;
using System.Web.Security;

public partial class Pages_Agent_AgentPopup : System.Web.UI.Page
{

    #region MyRegion
    public string AgentId { get; set; } 
    #endregion

    #region Events

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["AgentID"] != null)
        {
            AgentId = Request["AgentID"];
        }
        else 
            AgentId = string.Empty;
        if (!IsPostBack)
        {
            LoadData();
        }
    } 
    #endregion

    void LoadData()
    {
        // Fill AgentID
        Guest item = GuestDAO.CreateInstant().GetAgentById(AgentId);
        if (item != null)
        {
            txtGuestID.Text = item.GuestID;
            txtAddressLine1.Text = item.AddressLine1;
            txtAddressLine2.Text = item.AddressLine2;
            txtCity.Text = item.City;
            txtCompanyName.Text = item.CompanyName;
            txtEmail.Text = item.Email;
            txtFax.Text = item.Fax;
            txtFirstName.Text = item.FirstName;
            txtWebsite.Text = item.Website;
            txtNote.Text = item.Note;
            txtLastName.Text = item.Lastname;
            txtTel.Text = item.Tel;
            txtZipCode.Text = item.ZipCode;
            //ddlCountry.Text = item.CountryID.ToString();
            ddlTitle.Text = item.Title;
        }
    }
    
}
